{  Statement: http://acmp.ru/?main=task&id_task=23
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i,n,ans:longint;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
ans := 0;
for i:=1 to n do
    if n mod i = 0 then inc(ans,i);
write(ans);
end.
